package com.raft.framework.api;

import android.support.annotation.Keep;
import com.google.gson.annotations.SerializedName;

@Keep
public class BaseResult<T> {

  @SerializedName("code")
  public int statusCode;

  @SerializedName("data")
  public T data;

  @SerializedName("msg")
  public String msg;


  public Throwable error;


  public boolean isSuccess(){
    return statusCode == 0;
  }

  @Override
  public String toString() {
    return "BaseResult{" +
        "statusCode=" + statusCode +
        ", data=" + data +
        ", msg='" + msg + '\'' +
        ", error=" + error +
        '}';
  }
}
